package com.chrhc.projects.cpub.gen;

import java.io.IOException;

import com.chrhc.projects.cpub.gen.codegenerate.GenerateCode;
import com.chrhc.projects.cpub.gen.def.FtlDef;

import freemarker.template.TemplateException;

public class GenerateCodeTest
{
    
    // @Test
    public static void main(String args[])
    {
        String tableName = "cpub_netservice_askings"; //
        String codeName = "在线咨询表";// 中文注释 当然你用英文也是可以的
        String entityPackage = "netservice";// 实体包
        String leafEntityPackage = "askings";// 最下层的小业务 目前用来生成control的下级访问路径
        String keyType = FtlDef.KEY_TYPE_01;// 主键生成方式 01:UUID 02:自增
        String version = "1.0";
        GenerateCode gen = new GenerateCode();
        try
        {
        	gen.codeGenerate(tableName, codeName, entityPackage, keyType, leafEntityPackage, "王晨", version);
        }
        catch (IOException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        catch (TemplateException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
